<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/base.css" />
		<script type='text/javascript' src='<%=path%>/dwr/engine.js'></script>
		<script type='text/javascript' src='<%=path%>/dwr/util.js'></script>
		<script type="text/javascript" src="<%=path%>/js/popup.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.min.js"></script>
		<script language="javascript">
		    function check()
		    {
		         var name = $("#name").val();
		         if(!name){
		           alert("请输入课程名称");
		           return;
		        }  
  
		        document.formAdd.submit();
		    }
		    
		     function changeSelect(){
		        var fids = $("#fid").val();
		        if(fids!=0){
		            $.post("<%=path%>/getJigouList.action", { fid: fids},
					   function(data){
					         var datas = eval(data);
					         $("#jgid").empty();
					         $("#jgid").append("<option value='0'>请选择</option>");
					         for(var i=0;i<datas.length;i++){
					             var jg = datas[i];
					              $("#jgid").append("<option value='"+jg.id+"'>"+jg.name+"</option>");
					         }
					   });
		        }
		     }
		     
		     function bjSelect(){
		        var zids = $("#jgid").val();
		        if(zids!=0){
		            $.post("<%=path%>/getBanjiList.action", { zid: zids},
					   function(data){
					         var datas = eval(data);
					         $("#banji").empty();
					         $("#banji").append("<option value='0'>请选择</option>");
					         for(var i=0;i<datas.length;i++){
					             var jg = datas[i];
					              $("#banji").append("<option value='"+jg.id+"'>"+jg.name+"</option>");
					         }
					   });
		        }
		     }
        </script>
	</head>

	<body leftmargin="2" topmargin="9"
		background='<%=path%>/images/allbg.gif'>
		<form action="<%=path%>/courseAdd.action" name="formAdd"
			method="post">
			<table width="98%" align="center" border="0" cellpadding="4"
				cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom: 8px">
				<tr bgcolor="#EEF4EA">
					<td colspan="3" background="<%=path%>/images/wbg.gif"
						class='title'>
						<span>添加</span>
					</td>
				</tr>


 

				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						课程名称：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="name" name="name"  size="50" />
						<input type="hidden" id="state" name="state"   value="开放" />
					</td>
				</tr>
<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						上课时间：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="xq" name="xq"  size="50" />
						<input type="hidden" id="state" name="state"   value="开放" />
					</td>
				</tr>
               <tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						老师：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						 <select name="tid" id="tid"  >
						      <option value="0" >请选择</option>
							  <c:forEach items="${tlist}" var="tinfo">
							        <option value="${tinfo.id}">${tinfo.name}</option>
							  </c:forEach>
						</select>
					</td>
				</tr>

				 
               <tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						班级：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
					  
						<select name="fid" id="fid" onchange="changeSelect();">
						      <option value="0" >请选择</option>
							  <c:forEach items="${jigouList}" var="jg">
							        <option value="${jg.id}">${jg.name}</option>
							  </c:forEach>
						</select>
						
						<select name="jgid" id="jgid" onchange="bjSelect();">
						     <option value="0">请选择</option>
						</select>
	                    <select name="banji" id="banji">
						     <option value="0">请选择</option>
						</select>
					</td>
				</tr>


				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						&nbsp;
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="button" value="提交" onclick="check()" />
						&nbsp;
						<input type="reset" value="重置" />
						&nbsp;
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>